import { Alova } from '@/utils/http/alova';


export interface CpuInfo {
  timestamp: string;
  usage_percent: number;
  cores: number;
  model_name: string;
}

export interface MemoryInfo {
  timestamp: string;
  total: number;
  used: number;
  available: number;
  usage_percent: number;
}

export interface DiskInfo {
  timestamp: string;
  total: number;
  used: number;
  free: number;
  available: number;
}

export interface GpuInfo {
  timestamp: string;
  index: number;
  name: string;
  memory_total: number;
  memory_used: number;
  utilization: number;
}

export interface NetworkInfo {
  up : number;
  down: number;
  used_percent: number;
  up_speed: number;
  down_speed: number;
}

export interface SystemUsage {
  cpu: CpuInfo;
  memory: MemoryInfo;
  disk: DiskInfo;
  gpu: GpuInfo[];
  network: NetworkInfo;
}



// 获取系统使情况
export function getSystemUsage() {
  return Alova.Get<SystemUsage>('/monitor/system-usage');
}

